<template>
  <div class="app-projectinfo-bottom">
    <a href="javascript:void(0)" @click="todetails()">已完成任务</a>
  </div>
</template>

<script lang="ts">
import {
  Vue,
  Component,
  Prop,
  Model,
  Emit,
  Watch,
  Provide,
} from "vue-property-decorator";

import "./app-projectinfo-bottom.less";
import ProjectService from "@/service/project/project-service";
import UsersService from "@/service/user/user-service";

@Component({})
export default class AppProjectInfoBottom extends Vue {
  /**
   * 应用上下文
   *
   * @type {*}
   * @memberof AppProjectInfoBottom
   */
  @Prop() public context: any;

  /**
   * 跳转到已关闭页面
   *
   * @memberof AppProjectInfoBottom
   */
  public todetails() {
    let localContext: any = null;
    let localViewParam: any = null;
    const data: any = {};
    let tempContext = JSON.parse(JSON.stringify(this.context));
    Object.assign(tempContext, { project: this.context.project });
    let deResParameters: any[] = [];
    if (tempContext.project && true) {
      deResParameters = [{ pathName: "projects", parameterName: "project" }];
    }
    const parameters: any[] = [
      { pathName: "tasks", parameterName: "task" },
      { pathName: "closedgridview", parameterName: "closedgridview" },
    ];
    const _this: any = this;
    const openIndexViewTab = (data: any) => {
      const routePath = this.$viewTool.buildUpRoutePath(
        this.$route,
        tempContext,
        deResParameters,
        parameters,
        [],
        data
      );
      this.$router.push(routePath);
    };
    openIndexViewTab(data);
  }
}
</script>
